package vim.meet.aspect;

import cn.freemethod.aspect.annotation.Code;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class AnnotationAspect {

	private static final String NAME = AnnotationAspect.class.getName();
	
	@Pointcut("@annotation(cn.freemethod.aspect.annotation.Code)")
	void code(){}
	
	@After("@annotation(cn.freemethod.aspect.annotation.Code) && @annotation(code)")
//	@After("code() && @annotation(code)")
//	@After("execution(* cn.freemethod.aspect.target.AnnotationTarget.code()) && @annotation(code)")
	public void code(Code code)
	{
		System.out.println(code.value());
		System.out.println("in:"+ NAME + "code!");
	}
}
